<div class="config-container">
  <div class="title-cont">
    <h3 class="section-title">Tracking Tool Integration</h3>
    <span title="Can be used to specify links to an issue tracker. Go will construct a link based on the commit message that you can use to take you to your tracking tool (Mingle card, JIRA issue, Trac issue etc)." class="contextual_help has_go_tip_right"></span>
  </div>
<%= form_for @pipeline, :as => :pipeline, :url => pipeline_update_path(:pipeline_name => @pipeline.name(), :current_tab => 'project_management'), :html => {:method => :put, :id => 'pipeline_edit_form'} do |f| %>
    <div class="fieldset">
        <%= md5_field %>
        <%= hidden_field_tag :pipeline_digest, @pipeline_digest %>
        <%= hidden_field_tag :pipeline_group_name, @pipeline_group_name %>
        <div id="tracking_tool_container">
            <%= f.fields_for com.thoughtworks.go.config.PipelineConfig::TRACKING_TOOL, @pipeline.trackingTool do |t| %>
                <div class="form_item_block">
                    <div class="form_item_block required">
                        <%= required_label(t, :regex, 'Pattern')-%>
                        <%= t.text_field :regex %>
                        <div class="contextual_help has_go_tip_right" title="A regular expression to identify card or bug numbers from your checkin comments. <a class='' href='<%= docs_url '/integration/' %>' target='_blank'>More...</a>"></div>
                        <%= error_message_on(@pipeline.trackingTool, com.thoughtworks.go.config.TrackingTool::REGEX, :css_class => "form_error") %>
                    </div>
                    <div class="form_item_block required">
                        <%= required_label(t, :link, 'URI')-%>
                        <%= t.text_field :link %>
                        <div class="contextual_help has_go_tip_right" title="The URI to your tracking tool. This must contain the string ${ID} which will be replaced with the number identified using the pattern. <a class='' href='<%= docs_url '/integration/' %>' target='_blank'>More...</a>"></div>
                        <%= error_message_on(@pipeline.trackingTool, com.thoughtworks.go.config.TrackingTool::LINK, :css_class => "form_error") %>
                    </div>
                </div>
                <%= render :partial => 'shared/form_required_message.html', :locals => {:scope => {}} unless @is_config_repo_pipeline %>
            <% end %>
        </div>
    </div>
    <%= render :partial => "admin/shared/form_submit", :locals => {:scope => {:reset_url => pipeline_edit_path(:pipeline_name => params[:pipeline_name], :current_tab => 'project_management')}} unless @is_config_repo_pipeline %>
    </div>
<% end %>
</div>
</div>

